package com.legal.app.config;

/**
 * @author Ale
 * @description
 * @date 2025/6/18 8:33
 */


import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 微信开放平台配置
 * @author Ale
 */
@Component
@Data
public class WechatOpenConfig {
    @Getter
    @Value("${wechat.appId}")
    private String appId;
    @Getter
    @Value("${wechat.appSecret}")
    private String appSecret;
    @Setter
    @Getter
    private String redirectUri;
    private final String WX_LOGIN_SERVER_URL = "https://api.weixin.qq.com/sns/jscode2session?appid={0}&secret={1}&js_code={2}&grant_type=authorization_code";
    @Setter
    @Getter
    private String scope = "snsapi_userinfo";
    private String authUrl = "https://open.weixin.qq.com/connect/oauth2/authorize";
    private String tokenUrl = "https://api.weixin.qq.com/sns/oauth2/access_token";
    private String userInfoUrl = "https://api.weixin.qq.com/sns/userinfo";

    @Value("${wechat.appId}")
    public void setAppId(String appId) { this.appId = appId; }

    @Value("${wechat.appSecret}")
    public void setAppSecret(String appSecret) { this.appSecret = appSecret; }


}
